package com.huawei.appmarket.service.settings.bean.gameservice;

import com.huawei.appgallery.serverreqkit.api.bean.BaseResponseBean;
import java.util.ArrayList;
import java.util.List;
import o.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class GetGameServiceAuthAppListRes extends BaseResponseBean {
    private static final String AUTH_APP_LIST_KEY = "authorizedAppLists";
    private static final String TAG = "GetGameServiceAuthAppListRes";
    private List<AuthorizedAppInfo> authorizedAppLists;

    public List<AuthorizedAppInfo> ˏ() {
        return this.authorizedAppLists;
    }

    public void fromJson(JSONObject jSONObject) throws IllegalArgumentException, IllegalAccessException, InstantiationException, ClassNotFoundException, JSONException {
        super.fromJson(jSONObject);
        if (jSONObject.has(AUTH_APP_LIST_KEY)) {
            this.authorizedAppLists = new ArrayList();
            try {
                JSONArray optJSONArray = jSONObject.optJSONArray(AUTH_APP_LIST_KEY);
                if (optJSONArray != null && optJSONArray.length() > 0) {
                    for (int i = 0; i < optJSONArray.length(); i++) {
                        JSONObject jSONObject2 = optJSONArray.getJSONObject(i);
                        AuthorizedAppInfo authorizedAppInfo = new AuthorizedAppInfo();
                        authorizedAppInfo.fromJson(jSONObject2);
                        this.authorizedAppLists.add(authorizedAppInfo);
                    }
                }
            } catch (JSONException e) {
                Logger.ˋ(TAG, "parse auth app list meet json exception");
            }
        }
    }
}
